<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/8/29
 * Time: 16:14
 */

namespace app\api\controller\v1;

use app\api\model\Category as categoryMode;
use app\lib\exception\CategoryException;

class Category
{
    public function getAllCategories(){
//        $result = categoryMode::with('img')->select();
        $result = categoryMode::getAllCategorys();
        if (!$result){
            throw new CategoryException();
        }
        return $result;
    }
}